import httpx
import re
session=httpx.Client()
url='https://match.yuanrenxue.com/match/13'
headers = {
        "User-Agent": "yuanrenxue.project",
    }
cookies={
        "sessionid":"759esu9huxhrnbiji2n56518wlis3576"
}
session.cookies.update(cookies)
response=session.get(url,headers=headers)
cookie_=''.join(re.findall("[(]'(.*?)'[)]",response.text,re.S))
key,value=cookie_.split('=')

session.cookies.update({key: value})
# print(session.cookies)
all_value=0
for page in range(1,6):
    url_api = 'https://match.yuanrenxue.com/api/match/13?page={}'.format(page)
    res=session.get(url=url_api,headers=headers).json()
    # print(res)
    data=res.get('data')
    sum_value=0
    for da in data:
        sum_value+=da.get('value')
    print(f'第{page}页的和为:',sum_value)
    all_value+=sum_value
print(f'{page}页总和为',all_value)